home *** CD-ROM | disk | FTP | other *** search
-
-
-
- mmmmaaaakkkkeeeeddddeeeevvvviiiicccceeee((((DDDD3333)))) mmmmaaaakkkkeeeeddddeeeevvvviiiicccceeee((((DDDD3333))))
-
-
-
- NNNNAAAAMMMMEEEE
- _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee - make device number from major and minor numbers
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>>
- _dddd_eeee_vvvv______tttt _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee_((((_mmmm_aaaa_jjjj_oooo_rrrr______tttt _m_a_j_n_u_m_,,,, _mmmm_iiii_nnnn_oooo_rrrr______tttt _m_i_n_n_u_m_))))_;;;;
-
- AAAArrrrgggguuuummmmeeeennnnttttssss
- _m_a_j_n_u_m Major number.
-
- _m_i_n_n_u_m Minor number.
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- The _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee function creates a device number from major and minor
- device numbers.
-
- RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
- The device number, containing both the major number and the minor number,
- is returned. No validation of the major or minor numbers is performed.
-
- UUUUSSSSAAAAGGGGEEEE
- _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee should be used to create device numbers so that the driver
- will port easily to releases that treat device numbers differently.
-
- LLLLeeeevvvveeeellll
- Initialization, Base or Interrupt.
-
- SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
- Does not sleep.
-
- Driver-defined basic locks, read/write locks, and sleep locks may be held
- across calls to this function.
-
- SSSSiiiinnnngggglllleeeetttthhhhrrrreeeeaaaaddddeeeedddd EEEExxxxaaaammmmpppplllleeee
- In the following example, _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee is used to create the device number
- selected during a clone open. If the _CCCC_LLLL_OOOO_NNNN_EEEE_OOOO_PPPP_EEEE_NNNN flag is set (line 9), we
- search through the list of minor devices looking for one that is
- available (lines 10-11). If we find an unused minor, we break off the
- search, create a new device number, and store it in the memory location
- pointed to by _dddd_eeee_vvvv_pppp (line 15). If no unused minor was found, we return
- the error _EEEE_NNNN_XXXX_IIII_OOOO.
-
- _1111 _xxxx_xxxx_xxxx_oooo_pppp_eeee_nnnn_((((_qqqq_,,,, _dddd_eeee_vvvv_pppp_,,,, _oooo_ffff_llll_aaaa_gggg_,,,, _ssss_ffff_llll_aaaa_gggg_,,,, _cccc_rrrr_pppp_))))
- _2222 _qqqq_uuuu_eeee_uuuu_eeee______tttt _****_qqqq_;;;;
- _3333 _dddd_eeee_vvvv______tttt _****_dddd_eeee_vvvv_pppp_;;;;
- _4444 _iiii_nnnn_tttt _oooo_ffff_llll_aaaa_gggg_;;;;
- _5555 _iiii_nnnn_tttt _ssss_ffff_llll_aaaa_gggg_;;;;
- _6666 _cccc_rrrr_eeee_dddd______tttt _****_cccc_rrrr_pppp_;;;;
- _7777 _{{{{
- _8888 _mmmm_iiii_nnnn_oooo_rrrr______tttt _mmmm_iiii_nnnn_nnnn_uuuu_mmmm_;;;;
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- mmmmaaaakkkkeeeeddddeeeevvvviiiicccceeee((((DDDD3333)))) mmmmaaaakkkkeeeeddddeeeevvvviiiicccceeee((((DDDD3333))))
-
-
-
- _9999 _iiii_ffff _((((_ssss_ffff_llll_aaaa_gggg _====_==== _CCCC_LLLL_OOOO_NNNN_EEEE_OOOO_PPPP_EEEE_NNNN_)))) _{{{{
- _1111_0000 _ffff_oooo_rrrr _((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm _==== _0000_;;;; _mmmm_iiii_nnnn_nnnn_uuuu_mmmm _<<<< _XXXX_XXXX_XXXX_MMMM_AAAA_XXXX_MMMM_IIII_NNNN_;;;; _mmmm_iiii_nnnn_nnnn_uuuu_mmmm_++++_++++_))))
- _1111_1111 _iiii_ffff _((((_!!!!_IIII_NNNN_UUUU_SSSS_EEEE_((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm_))))_))))
- _1111_2222 _bbbb_rrrr_eeee_aaaa_kkkk_;;;;
- _1111_3333 _iiii_ffff _((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm _>>>>_==== _XXXX_XXXX_XXXX_MMMM_AAAA_XXXX_MMMM_IIII_NNNN_))))
- _1111_4444 _rrrr_eeee_tttt_uuuu_rrrr_nnnn_((((_EEEE_NNNN_XXXX_IIII_OOOO_))))_;;;;
- _1111_5555 _SSSS_EEEE_TTTT_IIII_NNNN_UUUU_SSSS_EEEE_((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm_))))_;;;;
- _1111_6666 _****_dddd_eeee_vvvv_pppp _==== _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee_((((_gggg_eeee_tttt_eeee_mmmm_aaaa_jjjj_oooo_rrrr_((((_****_dddd_eeee_vvvv_pppp_))))_,,,, _mmmm_iiii_nnnn_nnnn_uuuu_mmmm_))))_;;;;
- _1111_7777 _}}}}
- _...._...._....
-
- MMMMuuuullllttttiiiitttthhhhrrrreeeeaaaaddddeeeedddd EEEExxxxaaaammmmpppplllleeee
- In the following example, _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee is used to create the device number
- selected during a clone open. If the _CCCC_LLLL_OOOO_NNNN_EEEE_OOOO_PPPP_EEEE_NNNN flag is set (line 11), we
- lock the list of minor devices (line 12) and search through the list,
- looking for a minor device that is available (lines 13-14). If we find
- an unused minor, we break off the search, mark the minor as being in use
- (line 20), unlock the list, create a new device number, and store it in
- the memory location pointed to by _dddd_eeee_vvvv_pppp (line 22). If no unused minor was
- found, we unlock the list and return the error _EEEE_NNNN_XXXX_IIII_OOOO.
-
- _1111 _xxxx_xxxx_xxxx_oooo_pppp_eeee_nnnn_((((_qqqq_,,,, _dddd_eeee_vvvv_pppp_,,,, _oooo_ffff_llll_aaaa_gggg_,,,, _ssss_ffff_llll_aaaa_gggg_,,,, _cccc_rrrr_pppp_))))
- _2222 _qqqq_uuuu_eeee_uuuu_eeee______tttt _****_qqqq_;;;;
- _3333 _dddd_eeee_vvvv______tttt _****_dddd_eeee_vvvv_pppp_;;;;
- _4444 _iiii_nnnn_tttt _oooo_ffff_llll_aaaa_gggg_;;;;
- _5555 _iiii_nnnn_tttt _ssss_ffff_llll_aaaa_gggg_;;;;
- _6666 _cccc_rrrr_eeee_dddd______tttt _****_cccc_rrrr_pppp_;;;;
- _7777 _{{{{
- _8888 _mmmm_iiii_nnnn_oooo_rrrr______tttt _mmmm_iiii_nnnn_nnnn_uuuu_mmmm_;;;;
- _9999 _iiii_nnnn_tttt _pppp_llll_;;;;
- _1111_0000 _eeee_xxxx_tttt_eeee_rrrr_nnnn _llll_oooo_cccc_kkkk______tttt _****_xxxx_xxxx_xxxx_mmmm_iiii_nnnn_llll_oooo_cccc_kkkk_;;;;
- _1111_1111 _iiii_ffff _((((_ssss_ffff_llll_aaaa_gggg _====_==== _CCCC_LLLL_OOOO_NNNN_EEEE_OOOO_PPPP_EEEE_NNNN_)))) _{{{{
- _1111_2222 _pppp_llll _==== _LLLL_OOOO_CCCC_KKKK_((((_xxxx_xxxx_xxxx_mmmm_iiii_nnnn_llll_oooo_cccc_kkkk_,,,, _pppp_llll_ssss_tttt_rrrr_))))_;;;;
- _1111_3333 _ffff_oooo_rrrr _((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm _==== _0000_;;;; _mmmm_iiii_nnnn_nnnn_uuuu_mmmm _<<<< _XXXX_XXXX_XXXX_MMMM_AAAA_XXXX_MMMM_IIII_NNNN_;;;; _mmmm_iiii_nnnn_nnnn_uuuu_mmmm_++++_++++_))))
- _1111_4444 _iiii_ffff _((((_!!!!_IIII_NNNN_UUUU_SSSS_EEEE_((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm_))))_))))
- _1111_5555 _bbbb_rrrr_eeee_aaaa_kkkk_;;;;
- _1111_6666 _iiii_ffff _((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm _>>>>_==== _XXXX_XXXX_XXXX_MMMM_AAAA_XXXX_MMMM_IIII_NNNN_)))) _{{{{
- _1111_7777 _UUUU_NNNN_LLLL_OOOO_CCCC_KKKK_((((_xxxx_xxxx_xxxx_mmmm_iiii_nnnn_llll_oooo_cccc_kkkk_,,,, _pppp_llll_))))_;;;;
- _1111_8888 _rrrr_eeee_tttt_uuuu_rrrr_nnnn_((((_EEEE_NNNN_XXXX_IIII_OOOO_))))_;;;;
- _1111_9999 _}}}} _eeee_llll_ssss_eeee _{{{{
- _2222_0000 _SSSS_EEEE_TTTT_IIII_NNNN_UUUU_SSSS_EEEE_((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm_))))_;;;;
- _2222_1111 _UUUU_NNNN_LLLL_OOOO_CCCC_KKKK_((((_xxxx_xxxx_xxxx_mmmm_iiii_nnnn_llll_oooo_cccc_kkkk_,,,, _pppp_llll_))))_;;;;
- _2222_2222 _****_dddd_eeee_vvvv_pppp _==== _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee_((((_gggg_eeee_tttt_eeee_mmmm_aaaa_jjjj_oooo_rrrr_((((_****_dddd_eeee_vvvv_pppp_))))_,,,, _mmmm_iiii_nnnn_nnnn_uuuu_mmmm_))))_;;;;
- _2222_3333 _}}}}
- _2222_4444 _}}}}
- _...._...._....
-
- RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
- _gggg_eeee_tttt_eeee_mmmm_aaaa_jjjj_oooo_rrrr(D3), _gggg_eeee_tttt_eeee_mmmm_iiii_nnnn_oooo_rrrr(D3), _gggg_eeee_tttt_mmmm_aaaa_jjjj_oooo_rrrr(D3), _gggg_eeee_tttt_mmmm_iiii_nnnn_oooo_rrrr(D3)
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-